﻿using System;
using GC_RF.Domain.Abstractions.Interfaces.Helpers;
using GC_RF.Domain.Constants;

namespace GC_RF.Domain.Helpers
{
	public class FileManager : IFileManager
	{
		#region IFileManager Members

		public string GetFileExtByName(string fileName)
		{
			if (string.IsNullOrWhiteSpace(fileName) || !fileName.Contains(Symbols.Dot))
				return string.Empty;

			var dotIndex = fileName.IndexOf(Symbols.Dot, StringComparison.Ordinal);
			return fileName.Substring(dotIndex + 1, fileName.Length - dotIndex - 1);
		}

		#endregion
	}
}
